package edu.map.aamas.gui.colormaps;

import java.awt.Color;

public class ColorMapFactory {

	private ColorMapFactory() {}
	
	public static ColorMap createGrayScaleColorMap() {
		return new ColorMap() {
			public Color getColor(double value) {
				int rgbVal = (int) (value * 255);
				return new Color(rgbVal, rgbVal, rgbVal);
			}
		};
	}
	
	
	
	public static ColorMap createHotColorMap() {
		return new InterpolationColorMap(
			new double[] {0.0, 0.3333333, 0.66666666, 1.0},
			new Color[] {Color.BLACK, Color.RED, Color.YELLOW, Color.WHITE}
		);
	}
	
	public static ColorMap createAllColorsColorMap() {
		return new InterpolationColorMap(
			new double[] {0.0, 0.3333333, 0.66666666, 1.0},
			new Color[] {Color.BLACK, Color.BLUE, Color.YELLOW, Color.WHITE}
		);
	}
	

	
	public static ColorMap createRedGreenBlueColorMap() {
		return new InterpolationColorMap(
				new double[] {0.0, 0.5, 1.0},
				new Color[] {new Color(255,0,0),new Color(0,255,0),new Color(0,0,255)} 
		);
	}
	
	
	public static ColorMap createBlueGreenRed() {
		return new InterpolationColorMap(
				new double[] {0.0, 0.5, 1.0},
				new Color[] {new Color(0,0,255),new Color(0,255,0),new Color(255,0,0)} 
		);
	}
	
	public static ColorMap createBlueWhiteRedColormap() {
		return new InterpolationColorMap(
				new double[] {0.0, 0.5, 1.0},
				new Color[] {new Color(255,0,0),new Color(255,255,255),new Color(0,0,255)} 
		);
	}

	
	public static ColorMap createBlueToRedColorMap() {
		return new InterpolationColorMap(
				new double[] {0.0, 1.0},
				new Color[] {Color.BLUE, Color.RED} 
		);
	}
	
	public static ColorMap createAutummColorMap() {
		return new InterpolationColorMap(
				new double[] {0.0, 1.0},
				new Color[] {Color.RED, Color.YELLOW} 
		);
	}
	
	public static ColorMap createCoolColorMap() {
		return new InterpolationColorMap(
				new double[] {0.0, 1.0},
				new Color[] {Color.CYAN,Color.MAGENTA} 
		);
	}
	
	public static ColorMap createJetColorMap() {
		return new InterpolationColorMap(
				new double[] {0.0, 0.25, 0.5, 0.75, 1.0},
				new Color[] {Color.blue ,Color.cyan, Color.yellow, Color.red, Color.black} 
		);
	}
	
	public static ColorMap createSpringColorMap() {
		return new InterpolationColorMap(
				new double[] {0.0, 1.0},
				new Color[] {Color.magenta , Color.yellow} 
		);
	}
}
